package com.dabaozhan.modules.wx_app.service.impl;

import com.dabaozhan.common.utils.Utils;
import com.dabaozhan.modules.wx_app.dao.SaleFormMapper;
import com.dabaozhan.modules.wx_app.entity.FormQueryEntity;
import com.dabaozhan.modules.wx_app.entity.SaleFormEntity;
import com.dabaozhan.modules.wx_app.service.SaleFormService;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author houzhong
 * @date 2019-01-25 09:47
 */
@Service("saleFormService")
public class SaleFormServiceImpl implements SaleFormService {

    @Autowired
    private SaleFormMapper saleFormMapper;

    @Override
    public int saveSaleForm(SaleFormEntity v) {
        if (v.getId() == null) {
            v.setId(Utils.id().toString());
        }
        return saleFormMapper.save(v);
    }

	@Override
	public List<SaleFormEntity> getSaleList(FormQueryEntity entity) {
		return saleFormMapper.getSaleList(entity);
	}
}
